package com.cowin.inf.controller;

import com.cowin.base.annotation.LogAnnotation;
import com.cowin.base.result.Result;
import com.cowin.base.result.ResultGenerator;
import com.cowin.base.BaseController;
import com.cowin.inf.model.KyBdcRouteLog;
import com.cowin.inf.model.vo.KyBdcRouteLogVo;
import com.cowin.inf.model.vo.QueueVo;
import com.cowin.inf.service.KyBdcRouteLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created by  on 2019/09/23.
 *
 * @author CodeGenerator
 */
@Api(value = "KyBdcRouteLogController", description = "BDC路由日志控制器", tags = "KyBdcRouteLogController", consumes = "application/json")
@Slf4j
@RestController
@RequestMapping("/ky/bdc/route/log")
public class KyBdcRouteLogController extends BaseController<KyBdcRouteLog> {
    @Resource
    private KyBdcRouteLogService kyBdcRouteLogService;

    @ApiOperation(value = "日志查询过滤", notes = "日志查询过滤")
    @LogAnnotation("日志查询过滤接口")
    @PostMapping("/search")
    public Result filterRouteLog(@RequestBody KyBdcRouteLogVo kyBdcRouteLogVo) {
        PageHelper.startPage(kyBdcRouteLogVo.getPage(), kyBdcRouteLogVo.getLimit());
        List<KyBdcRouteLog> list = kyBdcRouteLogService.filterRouteLog(kyBdcRouteLogVo);
        PageInfo<KyBdcRouteLog> pageInfo = new PageInfo<>(list);
        return ResultGenerator.genSuccessResult(pageInfo);
    }
}
